
<%@ page import="br.unicarioca.viaexpositus.Comentario" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'comentario.label', default: 'Comentario')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
    </head>
    <body>
     	
        <div class="body">
            <div>
            	<h1><g:message code="default.edit.label" args="[entityName]" /></h1>
		        <div class="buttonsBar">
		            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
		            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
		        </div>
		        <div class="clear"></div>
	    	</div>    

            <div class="clear" >&nbsp;</div>

            <g:if test="${flash.message}">
                <div class="message">${flash.message}</div>
            </g:if>

            <g:hasErrors bean="${comentarioInstance}">
                <div class="errors">
                    <g:renderErrors bean="${comentarioInstance}" as="list" />
                </div>
            </g:hasErrors>

            <g:form method="post" >
                <div class="dialog">
	                <g:hiddenField name="id" value="${comentarioInstance?.id}" />
	                <g:hiddenField name="version" value="${comentarioInstance?.version}" />
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="texto"><g:message code="comentario.texto.label" default="Texto" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: comentarioInstance, field: 'texto', 'errors')}">
                                    <g:textField name="texto" value="${comentarioInstance?.texto}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="usuario"><g:message code="comentario.usuario.label" default="Usuario" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: comentarioInstance, field: 'usuario', 'errors')}">
                                    <g:select name="usuario.id" from="${br.unicarioca.viaexpositus.Usuario.list()}" optionKey="id" value="${comentarioInstance?.usuario?.id}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="avaliacao"><g:message code="comentario.avaliacao.label" default="Avaliacao" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: comentarioInstance, field: 'avaliacao', 'errors')}">
                                    <g:select name="avaliacao.id" from="${br.unicarioca.viaexpositus.Avaliacao.list()}" optionKey="id" value="${comentarioInstance?.avaliacao?.id}"  />
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                	<g:if test="${comentarioInstance.id}">
                    	<span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.save.label', default: 'Save')}" /></span>
                    </g:if>
                    <g:else>
                    	<span class="button"><g:actionSubmit class="save" action="save" value="${message(code: 'default.button.save.label', default: 'Save')}" /></span>	
                    </g:else>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
